FROM alpine:latest

WORKDIR /app

ENV CONSUL_HOST="consul-client" \
    CONSUL_PORT="8500"

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
    apk update && \
    apk add tzdata && \
    cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
    echo "Asia/Shanghai" > /etc/timezone

RUN mkdir /lib64 && \
    ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2

COPY . /app

CMD ./app -consul.host ${CONSUL_HOST} -consul.port ${CONSUL_PORT} -listen.addr :9091
